// import {_getUserInfo} from '@api/user'
import {
  getUserInfoUsingGET
} from '@api/auto'

import types from './types'
export default {
  async fetchUserInfo ({
    commit
  }) {
    let res = await getUserInfoUsingGET()
    if (res.status) {
      sessionStorage.userInfo = JSON.stringify(res.data)
      commit(types.SET_USER_ID, res.data.sn)
      commit(types.SET_USER_NAME, res.data.name)
      commit(types.SET_USER_TYPE, res.data.roleName)
    }
    return res
  }
}
